﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Ec_System.WebUI
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            /*
            //根据商品ID进入详细页
            routes.MapRoute(
                "ProductInfo",
                "Item/{productID}",
                new { controll = "ShopProduct", action = "ProductInfo" },
                new[] { "Ec_System.WebUI.Areas.Web.Controllers" }
                ).DataTokens.Add("area", "Web");
*/
            //默认路由--Web的首页
            routes.MapRoute(
                 "Default",
                "{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }, 
                new[] { "Ec_System.WebUI.Areas.Web.Controllers" }
            ).DataTokens.Add("area", "Web");
        }
    }
}
